Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI for N1471H (CAEN) #63

Merged
merged 40 commits into from
Sep 30, 2024
Merged

GUI for N1471H (CAEN) #63

merged 40 commits into from
Sep 30, 2024

Conversation

lobis
Copy link
Owner

@lobis lobis commented Aug 26, 2024

No description provided.

@lobis
Copy link
Owner Author

lobis commented Aug 27, 2024

@AlvaroEzq I made some changes to the file:

  • Rename to gui.py since python files are typically named using snake_case notation.
  • Add command line argument parsing so the user can specify the serial port (via the --port flag). I also added the --test flag so it can be used without the serial connection for testing, however, in order for this to work you need to add your caenSimulator module to the directory.
  • Modify some lambdas in 39669b7 and 1da155e. I think this is more correct but I am not 100% sure this achieves what you originally intended.

@lobis lobis marked this pull request as ready for review August 27, 2024 14:35
@lobis lobis requested a review from AlvaroEzq August 27, 2024 14:35
@lobis lobis added the enhancement New feature or request label Aug 27, 2024
@AlvaroEzq
Copy link
Collaborator

however, in order for this to work you need to add your caenSimulator module to the directory.

I added the caenSimulator module in the same directory as gui.py (face723).

Modify some lambdas in 39669b7 and 1da155e. I think this is more correct but I am not 100% sure this achieves what you originally intended.

Yes, this achives what I intended 👍

@AlvaroEzq
Copy link
Collaborator

The 1231d77 breaks the GUI when showing and hiding the ToolTip. Apparently, tkinter sends one extra parameter to the show_tooltip and hide_tooltip

self.widget.bind("<Enter>", self.show_tooltip)
self.widget.bind("<Leave>", self.hide_tooltip)
in this lines...

lobis added a commit that referenced this pull request Aug 28, 2024
@lobis
Copy link
Owner Author

lobis commented Aug 28, 2024

The 1231d77 breaks the GUI when showing and hiding the ToolTip. Apparently, tkinter sends one extra parameter to the show_tooltip and hide_tooltip

self.widget.bind("<Enter>", self.show_tooltip)
self.widget.bind("<Leave>", self.hide_tooltip)

in this lines...

Oh I see. I never use the event variable so it felt strange. Since I don't like to have unused variables (even if they are in fact used behind the scenes by the program) I like to remove them by wrapping the function in a lambda. This should work.

AlvaroEzq added a commit that referenced this pull request Aug 28, 2024
lobis added a commit that referenced this pull request Sep 6, 2024
lobis pushed a commit that referenced this pull request Sep 6, 2024
@lobis
Copy link
Owner Author

lobis commented Sep 27, 2024

@AlvaroEzq when you think this is ready please review and approve the PR (since you are the reviewer) and I'll merge it!

@lobis lobis merged commit 946c997 into main Sep 30, 2024
16 checks passed
@lobis lobis deleted the gui branch September 30, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants